package com.gml.jdk.lambda;

/**
 * @ClassName : LambdaTest2
 * @Description :
 * @Author : gml
 * @Date: 2020-10-23 14:28
 */
public class LambdaTest2 {

    public int a = 0;

    public void test(){
        int b = 1;
        Test test = () -> {
            System.out.println(b);
            System.out.println(a);
        };
        a = 11;
        //局部变量如果在lambda表达式内使用，默认为final属性
        //b = 12;

    }

    public static void main(String[] args) {
        GetPerson getPerson = Person::new;

    }

}

interface GetPerson{
    Person getPerson();
}

interface Test{
    void test();
}

class Person{

}